
	<h2>Lupa Password</h2>
	<hr />
	<h4>Silahkan masukkan email Anda:</h4>
	<br />
	<div class="error" style="display:none">Error</div>
	<form id="forgotpass" action="<?php echo base_url()?>lupa_password.html" class="styled" method="post">	
		<label for="name">Email</label>
		<input class="textbox" type="text" name="email" id="email" />
		
		<input type="submit" value="Kirim Password!" class="right button" />
		
	</form>

<script>
$("#forgotpass").submit(function(){
	var formInput = $(this).serialize();
	
	$.ajax({
		url: $(this).attr('action'),
		data: formInput,
		beforeSend : function(){
			$.fancybox.showActivity();
			$(".error").hide();
		},
		success: function(respon){
			var obj = jQuery.parseJSON(respon);
			if(obj.status == 'success'){
				window.location = "<?php echo base_url()?>"+obj.url;
			}else{
				$(".error").text(obj.msg);
				$(".error").fadeIn(1000);
			}
			
			$.fancybox.hideActivity();
		},
		type: "POST"
	});
	
	return false;
});
</script>